<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags"  prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>数据管理 - 证劵分析系统后台管理</title>
    	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
    <link rel="stylesheet" type="text/css"	href="./styles/finance.css">
    <script type="text/javascript" src="./javaScripts/jquery-1.5.1.min.js"></script>
    <SCRIPT type="text/javascript">
		window.onload = function() {
			var lis = document.getElementsByTagName("li");
			for (var i=0; i<lis.length; i++) {
				var oldClass;
				lis[i].onmouseover = function() {
					oldClass=this.getAttribute("class");
					this.setAttribute("class", "tr_after");
				}
				lis[i].onmouseout = function() {
						this.setAttribute("class", oldClass);
				}
			}
		}
	</SCRIPT> 
  </head>
  
  <body>
  	<div  style="border:1px solid #cccccc;height: auto !important; height: 300px; min-height: 300px;">
  	<table id="contain" width="90%">
  		<tr >
  			<td width="100%" align="right">
  				<form action="<%=basePath%>sys/data/dataQuery.action" id="searchForm" method="post" >
  					<table>
  						<tr>
  							<td>
  							<select name="key">
  								<option value="stockCode" selected="selected">股票代码</option>
  								<option value="stockName">证券简称</option>
  								<option value="stockType">证券类别</option>
  								<option value="stockBoard">行业类别</option>
  							</select>
  							关键字：<input type="text" name="value" title="请输入搜索关键字,比如6位数字的股票代码、或者股票名称" id="value"/> 
  								<input type="submit" name="搜索"/>
  							</td>
  						</tr>
  					</table>
  				</form>
  			</td>
  		</tr>
  		<tr>
  			<td>
  				<FONT color="red"><s:actionmessage name="emptyMsg" value="%{#attr.emptyMsg}"
  							cssErrorClass="simple" cssClass="simple"/></FONT>
  				
  				<ul>
  					<li>			
	  					 <table width="100%" id="stockList" align="left">
		  					<tr>
					    		<td width="80px">股票代码</td>
					    		<td width="100px">证券简称</td>
					    		<td width="100px">证券类别</td>
					    		<td width="230px">行业类别</td>
					    		<td width="100px">上市日期</td>
					    	</tr>
					    </table>
				    </li>
				    	<s:iterator value="#attr.pageStockList" step="1" var="stock">
					    <li>
						    <table align="left" width="100%">
					    		<tr>
					    			<td width="80px">
					    				<a href="<%=basePath%>sys/data/dataShow.action?stockCode=${stockCode}">
						    				<s:property value="stockCode"/>
					    				</a>
					    			</td>
					    			<td width="100px">
					    				<a href="<%=basePath%>sys/data/dataShow.action?stockCode=${stockCode}">
					    					<s:property value="stockName"/>
					    				</a>
					    			</td>
					    			<td width="100px"><s:property value="stockType"/></td>
					    			<td width="230px"><s:property value="stockBoard"/></td>
					    			<s:date name="#attr.listingDate" format="yyyy-MM-dd" id="date"/>
					    			<td width="100px"><s:property value="date"/><br></td>
					    		</tr>
				   			 </table>
			   		 	</li>
				    </s:iterator>
  				</ul>
  			</td>
  		</tr>
  		<tr   style="text-decoration:none;">
  			<td>
				 <s:if test="#attr.assistDto.totalPages gt 0">
					<div  class="pageNav">
						<!--define the url of the previous page and next page-->
					     <s:url id="url_index" value="/sys/data/dataListPages.action">
					         <s:param name="assistDto.currentPages" value="1"></s:param>
					     </s:url>
					     <s:url id="url_pre" value="/sys/data/dataListPages.action">
					         <s:param name="assistDto.currentPages" value="#attr.assistDto.currentPages-1"></s:param>
					     </s:url>
					     <s:url id="url_next" value="/sys/data/dataListPages.action">
					         <s:param name="assistDto.currentPages" value="#attr.assistDto.currentPages+1"></s:param>
					     </s:url> 
					     <s:url id="url_end" value="/sys/data/dataListPages.action">
					         <s:param name="assistDto.currentPages" value="#attr.assistDto.totalPages"></s:param>
					     </s:url> 
						<table align="center">
							<tr>
								<td>
									<s:if test="#attr.assistDto.currentPages==1">首页&nbsp;&nbsp;</s:if>
								 	<s:else><s:a href="%{url_index}">首页&nbsp;&nbsp;</s:a></s:else>
								</td>
								<td>
									<s:if test="#attr.assistDto.currentPages > 1">
										<s:a href="%{url_pre}">上一页&nbsp;&nbsp;</s:a>
									</s:if>
									<s:else>上一页&nbsp;&nbsp;</s:else>
								</td>
								<td>第${attr.assistDto.currentPages} 页&nbsp;&nbsp;</td>
								<td>
									<s:if test="#attr.assistDto.currentPages != #attr.assistDto.totalPages">
										<s:a href="%{url_next}">下一页&nbsp;&nbsp;</s:a>
									</s:if>
									<s:else>下一页&nbsp;&nbsp;</s:else>
								</td>
								<td>
									<s:if test="#attr.assistDto.currentPages == #attr.assistDto.totalPages">尾页&nbsp;&nbsp;</s:if>
									<s:else>
										<s:a href="%{url_end}">尾页&nbsp;&nbsp;</s:a> 
									</s:else>
								</td>
								<td>
									   共${attr.assistDto.totalPages}页 &nbsp;&nbsp;
								</td> 
							</tr>
						</table>
					</div>	
				</s:if>
  			</td>
  		</tr>
  	</table>
  </div>
  </body>
</html>
